import 'package:flutter/material.dart';

/**
 * 
 * 圆角容器
 * 
 */
class RoundedBox extends StatelessWidget {
  Widget child;
  final double width;
  final double height;
  // 圆角半径
  final double borderRadius;

  Color bgColor = Colors.black26;
  Color borderColor = Colors.white;
  double borderWidth = 1;

  RoundedBox(
      {Key key,
      this.child,
      this.borderColor,
      this.width,
      this.height,
      this.borderRadius})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      width: this.width,
      height: this.height,
      child: this.child,
      alignment: Alignment.center,
      decoration: BoxDecoration(
          color: this.bgColor,
          borderRadius: BorderRadius.circular(this.borderRadius),
          shape: BoxShape.rectangle
          //   boxShadow: [
          //     // // 阴影
          //     // BoxShadow(
          //     //   color: Colors.grey[50],
          //     //   // 偏移位置，以中心点为参考
          //     //   offset: Offset(0, 0),
          //     //   // 凝炼程度（密度）越大越散
          //     //   blurRadius: 40.0,
          //     //   // 扩散程度（远近）
          //     //   spreadRadius: 10.0,
          //     // )
          //   ],
          ),
    );
  }
}
